/*
 * Copyright (c) 2005 -2008 Reliable Source, Inc. and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Mozilla Public License v.1.1,
 * BSD, and Eclipse Public License v1.0 which accompanies this
 * distribution and is available at:
 *
 * 		http://www.eclipse.org/legal/epl-v10.html
 * 		http://www.opensource.org/licenses/bsd-license.php
 * 		http://www.mozilla.org/MPL/MPL-1.1.html
 *
 * Contributors:
 *     IBM Corporation	     -  http://ibm.com
 *     	- initial API and implementation
 *
 *     patientos.org         - http://patientos.org
 *     	- domain and database persistence layer
 *
 *     Reliable Source, Inc. - http://reliablesource.org
 *     	- Symbiosys Application Framework,
 *     	- Symbiosys Application, Symbiosys Product
 *
 */
package org.reliablesource.symbiosys.tests.core;


//package org.reliablesource.symbiosys.tests.core;
//
//import junit.framework.TestCase;
//
//import org.reliablesource.prism.core.IPrismElementFactory;
//import org.reliablesource.prism.core.IPrismScreen;
//import org.reliablesource.prism.core.IPrismTutorial;
//import org.reliablesource.prism.core.IPrismUnit;
//import org.reliablesource.prism.core.plugin.PrismCorePlugin;
//
///**
// *
// *  PrismTutorialTest.java
// *
// *	Created on: Sep 20, 2006 
// *  @author Dennis Park 
// *  	<a href="mailto:dennis.park@gmail.com">dennis.park@gmail.com</a>
// *
// */
//public class PrismTutorialTest extends TestCase {
//	
//	IPrismElementFactory factory;
//	IPrismTutorial tutorial;
//	/**
//	 * @param arg0
//	 */
//	public PrismTutorialTest(String arg0) {
//		super(arg0);
//		factory = PrismCorePlugin.getDefault().getElementFactory();
//		assertNotNull(factory);
//	}
//
//	/* (non-Javadoc)
//	 * @see junit.framework.TestCase#setUp()
//	 */
//	/*
//	 * (non-Javadoc)
//	 * 
//	 * @see junit.framework.TestCase#setUp()
//	 */
//	protected void setUp() throws Exception {
//		super.setUp();
//		assertNull(tutorial);
//		tutorial = factory.createTutorialNode();
//		assertNotNull(tutorial);
//	}
//
//	/*
//	 * (non-Javadoc)
//	 * 
//	 * @see junit.framework.TestCase#tearDown()
//	 */
//	protected void tearDown() throws Exception {
//		super.tearDown();
//		assertNotNull(tutorial);
//		tutorial = null;
//		assertNull(tutorial);
//	}
//
//	/**
//	 * Test method for {@link org.reliablesource.prism.core.internal.PrismTutorial#PrismTutorial()}.
//	 */
//	public final void testPrismTutorial() {
//		assertEquals("Model contains more than one tutorial.", tutorial, factory.createTutorialNode());
//		assertNotNull(tutorial.getId());
//		assertNotNull(tutorial.getName());
//		assertNotNull(tutorial.getParent());
//	}
//
//	/**
//	 * Test method for {@link org.reliablesource.prism.core.internal.PrismNode#PrismNode()}.
//	 */
//	public final void testPrismNode() {		
//		assertNotNull(tutorial.getId());
//		assertNotNull(tutorial.getName());
//		assertNotNull(tutorial.getParent());
//	}
//
//	/**
//	 * Test method for {@link org.reliablesource.prism.core.internal.PrismNode#getChildren()}.
//	 */
//	public final void testGetChildren() {
//		assertNotNull("Tutorial returned null on getChildren", tutorial.getChildren());
//		int nChildren = tutorial.getChildren().length;		
//		factory.createScreen();
//		int n1Children = tutorial.getChildren().length;
//		assertTrue("Tutorial getChildren failed after child creation",nChildren+1 == n1Children);
//	}
//
//	/**
//	 * Test method for {@link org.reliablesource.prism.core.internal.PrismNode#addChild(org.reliablesource.prism.core.IPrismUnit)}.
//	 */
//	public final void testAddChild() {
//		int preCreate = tutorial.getChildListSize();
//		factory.createScreen();
//		assertTrue("Post-screen creation, tutorial has no children.", tutorial.getChildListSize() > preCreate);
//		factory.createScreen();
//		factory.createScreen();
//		assertTrue("Post-screen creation 2 , tutorial does not have 3 children.",
//				tutorial.getChildListSize() == preCreate + 3);	
//	}
//
//	/**
//	 * Test method for {@link org.reliablesource.prism.core.internal.PrismNode#removeChild(org.reliablesource.prism.core.IPrismUnit)}.
//	 */
//	public final void testRemoveChild() {
//		int preCreate = tutorial.getChildListSize();
//		IPrismScreen scr1 = factory.createScreen();
//		assertTrue("Post-screen creation, tutorial has no children.", tutorial.getChildListSize() > preCreate);
//		IPrismScreen scr2 = factory.createScreen();
//		IPrismScreen scr3 = factory.createScreen();
//		assertTrue("Post-screen creation 2 , tutorial children is not > preCreate children length.",
//				tutorial.getChildListSize() > preCreate);
//		tutorial.removeChild(scr1);
//		tutorial.removeChild(scr2);
//		tutorial.removeChild(scr3);
//		
//		assertTrue("num. children is not equal to preCreate, after symmetric removal.", 
//				tutorial.getChildListSize() == preCreate);
//	}
//
//	/**
//	 * Test method for {@link org.reliablesource.prism.core.internal.PrismNode#getChild(int)}.
//	 */
//	public final void testGetChildInt() {
//		
//		int nChildren = tutorial.getChildren().length;
//		Object [] children = tutorial.getChildren();
//		
//		for(int i = 0; i < nChildren; i++)
//			assertSame("getChildInt call failed.", children[i], tutorial.getChild(i));
//	}
//
//	/**
//	 * Test method for {@link org.reliablesource.prism.core.internal.PrismNode#containsChild(org.reliablesource.prism.core.IPrismUnit)}.
//	 */
//	public final void testContainsChildIPrismUnit() {
//		int nChildren = tutorial.getChildren().length;
//		Object [] children = tutorial.getChildren();
//		
//		for(int i = 0; i < nChildren; i++)
//			assertTrue("tutorial failed to verify childs' membership.",tutorial.containsChild((IPrismUnit) children[i]));
//	}
//
//	/**
//	 * Test method for {@link org.reliablesource.prism.core.internal.PrismNode#getChildSequence(org.reliablesource.prism.core.IPrismUnit)}.
//	 */
//	public final void testGetChildSequence() {
//		int nChildren = tutorial.getChildren().length;
//		Object [] children = tutorial.getChildren();
//		
//		for(int i = 0; i < nChildren; i++)
//			assertSame("tutorial failed to retrieve child by sequence.",tutorial.getChild(i), children[i]);
//	}
//
//}
